﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YX
{
    class FatherBullt:BaseClass
    {
        private Image image;
        public int Power
        {
            get;
            set;
        }
        public FatherBullt(FatherPlane FJ, Image imag, int speed, int power)
            : base(FJ.X + FJ.Width / 2 - 26, FJ.Y + FJ.Hiegth / 2 - 50, imag.Width, imag.Height, speed, 0, FJ.Dir)
        {
            this.image = imag;
            this.Power = power;
        }
        public override void Draw(System.Drawing.Graphics g)
        {
            Move();
            g.DrawImage(image, this.X,this.Y,this.Width / 2, this.Hiegth / 2);
        }
        public override void Move()
        {
            switch (this.Dir)
            {
                case Direction.Up:
                    this.Y -= Speed;
                    break;
                case Direction.Down:
                    this.Y += Speed;
                    break;
            }
            if (this.Y<= 0)
            {
                this.Y = -100;
                SingleClass.GetSingle.RemoveClass(this);
            }
            if (this.Y >= 700)
            {
                this.Y = 1000;
                SingleClass.GetSingle.RemoveClass(this);
            }
        }
    }
}
